Optimal. Leaf size=298 \[ \frac {\left (b^2 e^2 g^2+c^2 \left (3 e^2 f^2+2 d e f g+d^2 g^2\right )+2 c e g (a e g-b (2 e f+d g))\right ) (d+e x)^{1+m}}{e^3 g^4 (1+m)}-\frac {2 c (c e f+c d g-b e g) (d+e x)^{2+m}}{e^3 g^3 (2+m)}+\frac {c^2 (d+e x)^{3+m}}{e^3 g^2 (3+m)}+\frac {\left (c f^2-b f g+a g^2\right )^2 (d+e x)^{1+m}}{g^4 (e f-d g) (f+g x)}+\frac {\left (c f^2-b f g+a g^2\right ) (c f (4 d g-e f (4+m))-g (a e g m+b (2 d g-e f (2+m)))) (d+e x)^{1+m} \, _2F_1\left (1,1+m;2+m;-\frac {g (d+e x)}{e f-d g}\right )}{g^4 (e f-d g)^2 (1+m)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.73, antiderivative size = 298, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {963, 1634, 70}
\begin {gather*} \frac {(d+e x)^{m+1} \left (2 c e g (a e g-b (d g+2 e f))+b^2 e^2 g^2+c^2 \left (d^2 g^2+2 d e f g+3 e^2 f^2\right )\right )}{e^3 g^4 (m+1)}-\frac {(d+e x)^{m+1} \left (a g^2-b f g+c f^2\right ) \, _2F_1\left (1,m+1;m+2;-\frac {g (d+e x)}{e f-d g}\right ) (g (a e g m+2 b d g-b e f (m+2))-c f (4 d g-e f (m+4)))}{g^4 (m+1) (e f-d g)^2}+\frac {(d+e x)^{m+1} \left (a g^2-b f g+c f^2\right )^2}{g^4 (f+g x) (e f-d g)}-\frac {2 c (d+e x)^{m+2} (-b e g+c d g+c e f)}{e^3 g^3 (m+2)}+\frac {c^2 (d+e x)^{m+3}}{e^3 g^2 (m+3)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 70
Rule 963
Rule 1634
Rubi steps
\begin {align*} \int \frac {(d+e x)^m \left (a+b x+c x^2\right )^2}{(f+g x)^2} \, dx &=\frac {\left (c f^2-b f g+a g^2\right )^2 (d+e x)^{1+m}}{g^4 (e f-d g) (f+g x)}+\frac {\int \frac {(d+e x)^m \left (\frac {c^2 f^3 (d g-e f (1+m))-2 c f g (b f-a g) (d g-e f (1+m))-g^2 \left (a^2 e g^2 m-b^2 f (d g-e f (1+m))+2 a b g (d g-e f (1+m))\right )}{g^4}+\frac {(e f-d g) \left (c^2 f^2+b^2 g^2-2 c g (b f-a g)\right ) x}{g^3}-\frac {c (c f-2 b g) (e f-d g) x^2}{g^2}-c^2 \left (d-\frac {e f}{g}\right ) x^3\right )}{f+g x} \, dx}{e f-d g}\\ &=\frac {\left (c f^2-b f g+a g^2\right )^2 (d+e x)^{1+m}}{g^4 (e f-d g) (f+g x)}+\frac {\int \left (\frac {(e f-d g) \left (b^2 e^2 g^2+c^2 \left (3 e^2 f^2+2 d e f g+d^2 g^2\right )+2 c e g (a e g-b (2 e f+d g))\right ) (d+e x)^m}{e^2 g^4}-\frac {2 c (e f-d g) (c e f+c d g-b e g) (d+e x)^{1+m}}{e^2 g^3}+\frac {c^2 (e f-d g) (d+e x)^{2+m}}{e^2 g^2}+\frac {\left (c f^2-b f g+a g^2\right ) (-g (2 b d g+a e g m-b e f (2+m))+c f (4 d g-e f (4+m))) (d+e x)^m}{g^4 (f+g x)}\right ) \, dx}{e f-d g}\\ &=\frac {\left (b^2 e^2 g^2+c^2 \left (3 e^2 f^2+2 d e f g+d^2 g^2\right )+2 c e g (a e g-b (2 e f+d g))\right ) (d+e x)^{1+m}}{e^3 g^4 (1+m)}-\frac {2 c (c e f+c d g-b e g) (d+e x)^{2+m}}{e^3 g^3 (2+m)}+\frac {c^2 (d+e x)^{3+m}}{e^3 g^2 (3+m)}+\frac {\left (c f^2-b f g+a g^2\right )^2 (d+e x)^{1+m}}{g^4 (e f-d g) (f+g x)}-\frac {\left (\left (c f^2-b f g+a g^2\right ) (g (2 b d g+a e g m-b e f (2+m))-c f (4 d g-e f (4+m)))\right ) \int \frac {(d+e x)^m}{f+g x} \, dx}{g^4 (e f-d g)}\\ &=\frac {\left (b^2 e^2 g^2+c^2 \left (3 e^2 f^2+2 d e f g+d^2 g^2\right )+2 c e g (a e g-b (2 e f+d g))\right ) (d+e x)^{1+m}}{e^3 g^4 (1+m)}-\frac {2 c (c e f+c d g-b e g) (d+e x)^{2+m}}{e^3 g^3 (2+m)}+\frac {c^2 (d+e x)^{3+m}}{e^3 g^2 (3+m)}+\frac {\left (c f^2-b f g+a g^2\right )^2 (d+e x)^{1+m}}{g^4 (e f-d g) (f+g x)}-\frac {\left (c f^2-b f g+a g^2\right ) (g (2 b d g+a e g m-b e f (2+m))-c f (4 d g-e f (4+m))) (d+e x)^{1+m} \, _2F_1\left (1,1+m;2+m;-\frac {g (d+e x)}{e f-d g}\right )}{g^4 (e f-d g)^2 (1+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [F]
time = 0.99, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(d+e x)^m \left (a+b x+c x^2\right )^2}{(f+g x)^2} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.06, size = 0, normalized size = 0.00 \[\int \frac {\left (e x +d \right )^{m} \left (c \,x^{2}+b x +a \right )^{2}}{\left (g x +f \right )^{2}}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: HeuristicGCDFailed} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (d+e\,x\right )}^m\,{\left (c\,x^2+b\,x+a\right )}^2}{{\left (f+g\,x\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________